package chapter5.No5_1_定时器Timer的使用.demo12;

import java.util.Calendar;
import java.util.Date;
import java.util.Timer;

/**
 * timer.scheduleAtFixedRate(m1, d, 4000); 具备追赶性
 * timer.schedule(m1, d, 4000); 不具备追赶性
 */
public class Main {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();
        c.add(Calendar.SECOND, -10);
        Date d = c.getTime();
        System.out.println("当前时间" + new Date());
        MyTask m1 = new MyTask();
        Timer timer = new Timer();

        timer.scheduleAtFixedRate(m1, d, 4000);
//        timer.schedule(m1, d, 4000);

    }
}
